<template>
	<view class="content">
		<view class="list-b">
			<view class="list" v-for="(item, index) in goodslist">
				<view @click="go(item)" class="list-item">
					<img :src="item.image" />
					<view class="right">
						<p class="tit">{{item.name}}</p>
						<view class="tag flex">
							<view class="gf" v-if="item.guanfang == 1">
								<img v-if="true" src="@/assets/gf.png" alt="" />
								<img v-else src="@/assets/zp.png" alt="" />
								<!-- <span>官方检测</span> -->
							</view>
							<view class="gf" v-if="item.huoyuan == 1">
								<img v-if="true" src="@/assets/hy.png" alt="" />
								<!-- <span>货源认证</span> -->
								<img v-else src="@/assets/ys.png" alt="" />
							</view>
							<!-- <u-tag
			      size="mini"
			      text="真品保障"
			      color="#FFF"
			      bg-color="#000"
			      icon="integral"
			    ></u-tag>
			    <u-tag
			      size="mini"
			      text="一手货源"
			      color="#0192FC"
			      border-color="#0192FC"
			      bg-color="#FFF"
			      plain
			      icon="integral"
			    ></u-tag> -->
						</view>
						<view class="price">
							<text class="money">¥ <text>{{item.price}}</text><text style="font-size: 24rpx">/吨
								</text></text>
							<text class="num">月{{item.stock}}吨</text>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		name: "index",
		components: {},
		props: {
			goodslist: {
				type: Array
			}
		},
		data() {
			return {
				list: [{}, {}, {}, {}, {}, {}, {}],
			};
		},
		methods: {
			go(e) {
				uni.navigateTo({
					url: "/pages/buy/supplyDetails?id=" + e.id
				});
			},
		},
		created() {},
		mounted() {},
	};
</script>

<style lang="scss" scoped>
	.content {
		// margin: 20rpx;
		// border-right: 12rpx;

		padding: 20rpx 20rpx 20rpx 20rpx;

		.list-b {
			border-radius: 12rpx;
			overflow: hidden;
		}


		.list {

			padding: 10rpx 20rpx;

			background-color: #fff;

			.list-item {

				display: flex;
				padding: 20rpx 10rpx;
				border-bottom: 1rpx solid #f4f4f4;
				align-items: center;
				gap: 20rpx;
				color: #131313;

				.right {
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					height: 100px;

					.tit {
						font-weight: 700;
						font-size: 28rpx;
						width: 378rpx;
					}

					.tag {
						gap: 20rpx;

						.gf {
							width: 122rpx;
							// background: #000;
							border-radius: 2rpx;
							height: 32rpx;
							display: flex;
							align-items: center;
							justify-content: center;

							img {
								width: 100%;
								height: 100%;
							}
						}
					}

					.price {
						display: flex;
						align-items: baseline;
						gap: 20rpx;

						.num {
							color: #686868;
							font-size: 20rpx;
							font-weight: 400;
							margin-bottom: 2rpx;
						}

						.money {
							font-weight: 500;
							color: #ff4435;

							text {
								font-size: 40rpx;
								font-weight: 700;
							}
						}
					}
				}

				img {
					width: 200rpx;
					height: 200rpx;
					border-radius: 12rpx;
				}
			}


		}

		.list-b :last-child {
			.list-item {
				border: none;
			}
		}
	}
</style>